﻿<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

</head>

<body>
    <div id="app" v-cloak class="popupW100">
        <el-form label-position="right" :model="Form" status-icon :rules="rules" ref="ruleForm" label-width="100px"
            size="mini">
            <el-row>
                <el-col :span="11">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.DevicePipeName" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{BlindBoardInformation.DevicePipeName+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="11" :offset="2">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.Position" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{BlindBoardInformation.Position+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="11">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.Material" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{BlindBoardInformation.Material+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="11" :offset="2">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.Specification" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{BlindBoardInformation.Specification+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
            </el-row>

            <el-row>
                <el-col :span="11">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.BlindPlateOperator" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{BlindBoardInformation.BlindPlateOperator+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>


                <el-col :span="11" :offset="2">
                    <el-form-item>
                        <div class="elst-select-mini" style="margin-left: -100px">
                            <el-input size="mini">
                                <template slot="prepend">
                                    {{BlindBoardInformation.BlindTime+mark.m}}
                                </template>
                                <el-date-picker slot="suffix" v-model="Form.BlindTime" type="date" size="mini"
                                    format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择时间">
                                </el-date-picker>
                            </el-input>
                        </div>
                    </el-form-item>
                </el-col>

                <el-col :span="11">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.BlindPanelGuardian" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{BlindBoardInformation.BlindPanelGuardian+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="11" :offset="2">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.BlockingPlateOperator" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{BlindBoardInformation.BlockingPlateOperator+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
            </el-row>

            <el-row>
                <el-col :span="11">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.BlockingGuardian" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{BlindBoardInformation.BlockingGuardian+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>

                <el-col :span="11" :offset="2">
                    <el-form-item>
                        <div class="elst-select-mini" style="margin-left: -100px">
                            <el-input size="mini">
                                <template slot="prepend">
                                    {{BlindBoardInformation.BlockingTime+mark.m}}
                                </template>
                                <el-date-picker slot="suffix" v-model="Form.BlockingTime" type="date" size="mini"
                                    format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择时间">
                                </el-date-picker>
                            </el-input>
                        </div>
                    </el-form-item>
                </el-col>

            </el-row>
            <el-row type="flex" justify="end">
                <el-form-item>
                    <!--<el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnConfirm}}</el-button>-->

                    <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnSave}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>

    </div>
    <script type="text/javascript">
        var app = new Vue({
            el: '#app',
            data: {
                //父业传参
                id: '',
                //业务表单内容
                Form: {
                    id: guidEmpty,
                    DevicePipeName: "",
                    Position: "",
                    Material: "",
                    Specification: "",
                    BlindPlateOperator: "",
                    BlindTime: "",
                    BlindPanelGuardian: "",
                    BlockingPlateOperator: "",
                    BlockingTime: "",
                    BlockingGuardian: "",
                },
                RiskLevel: [],
                //表单验证
                rules: {
                    DevicePipeName: [
                        verification.NotNull,
                        { pattern: verification.StringLengthAtoB.t.format(5, 50), message: verification.StringLengthAtoB.m.format(5, 10), trigger: 'blur' }
                    ],
                    Position: [
                        verification.NotNull,
                        { pattern: verification.StringLengthAtoB.t.format(5, 50), message: verification.StringLengthAtoB.m.format(5, 10), trigger: 'blur' }
                    ],
                    Material: [
                        verification.NotNull,
                        { pattern: verification.StringLengthAtoB.t.format(5, 100), message: verification.StringLengthAtoB.m.format(5, 10), trigger: 'blur' }
                    ],
                    Specification: [
                        verification.NotNull,
                        { pattern: verification.StringLengthAtoB.t.format(5, 100), message: verification.StringLengthAtoB.m.format(5, 10), trigger: 'blur' }
                    ],
                    BlindPlateOperator: [
                        verification.NotNull,
                        { pattern: verification.StringLengthAtoB.t.format(5, 100), message: verification.StringLengthAtoB.m.format(5, 10), trigger: 'blur' }
                    ],
                    BlindPanelGuardian: [
                        verification.NotNull,
                        { pattern: verification.StringLengthAtoB.t.format(5, 100), message: verification.StringLengthAtoB.m.format(5, 10), trigger: 'blur' }
                    ],
                    BlockingPlateOperator: [
                        verification.NotNull,
                        { pattern: verification.StringLengthAtoB.t.format(5, 100), message: verification.StringLengthAtoB.m.format(5, 10), trigger: 'blur' }
                    ],
                    BlockingGuardian: [
                        verification.NotNull
                    ]
                }
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },

                //提交数据
                onSubmitForm: function (formName) {
                    var mythis = this;
                    this.$refs[formName].validate(function (valid) {
                        //验证通过
                        if (valid) {
                            onSubmitForm(this, '/api/BlindBoardInformation/Save', mythis.Form);
                        } else {
                            //验证失败
                            return false;
                        }
                    });

                },
                getData: function () {
                    getData(this, '/api/BlindBoardInformation/get?id=' + this.id);
                }
            },
            mounted: function () {
                this.id = getUrlParam("id");
                this.getData();
            }
        });
    </script>
</body>

</html>